﻿//------------------------------------------------------------------------------------------------- 
// <copyright file="CAMLUtils.cs" company="Collaboris Ltd">
// Copyright (c) Collaboris Ltd.  All rights reserved.
// </copyright>
// <summary>Defines the ActionRepository type.</summary>
//-------------------------------------------------------------------------------------------------
namespace Collaboris.Saf.Utilities
{
    using System.Xml;

    using Utils;

    public class CAMLUtils
    {

        /// <summary>
        /// Creates NameSpaces necessary to query against
        /// Xml Documents based on the CAML.
        /// </summary>
        /// <returns></returns>
        public static XmlNamespaceManager CreateCAMLNameSpaceMgr(XmlDocument doc)
        {
            ValidationHelper.VerifyObjectArgument(doc, "doc");
            XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable);
            nsmgr.AddNamespace("CAML", "http://schemas.microsoft.com/sharepoint/");
            return nsmgr;
        }

    }
}